package com.kaba.common.enumeration;

/**
 * 状态码枚举类
 */
public enum ResultCode {
    // 成功
    SUCCESS(200, "成功"),

    //1 开头 用户 异常
    LECTURER_REQUISITION_REGISTERED(1000, "用户或密码错误"),
    USERNAME_NOTFOUNT(1001,"用户名不存在"),
    TOKEN_PAST(1002, "token过期"),
    TOKEN_ERROR(1003, "token异常"),
    USER_NOT_LOGIN(1001, "用户未登录"),
    USER_ACCOUNT_EXPIRED(1002, "账号已过期"),
    USER_CREDENTIALS_ERROR(1003, "密码错误"),
    USER_CREDENTIALS_EXPIRED(1004, "密码过期"),
    USER_ACCOUNT_DISABLE(1005, "账号不可用"),
    USER_ACCOUNT_LOCKED(1006, "账号被锁定"),
    USER_ACCOUNT_NOT_EXIST(1007, "账号不存在"),
    USER_ACCOUNT_ALREADY_EXIST(1008, "账号已存在"),
    USER_ACCOUNT_USE_BY_OTHERS(1009, "账号下线"),
    COMMON_FAIL(1100,"未知错误"),

    // 2开头 业务操作
    COURSE_SAVE_FAIL(2000, "添加失败"),
    COURSE_UPDATE_FAIL(2001, "更新失败"),
    COURSE_DELETE_FAIL(2002, "删除失败"),

    //3开头. 权限相关
    //角色表单验证
    ROLE_EXIST( 4001, "该角色已经存在！"),
    PERMISSION_DENIED(4002, "权限不足,请联系管理员"),
    LOGIN_SUCCESS(4003,"登录成功"),

    // 错误
    ERROR_SYS(997, "系统异常了....."),
    ERROR_INFAC(998, "出错了请稍后尝试....."),
    ERROR(999, "服务器出错了请稍后尝试....."),
    INVALID_PARAMETERS(1001, "参数异常");




    private Integer code; //状态码

    private String message; //描述信息




    private ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public Integer getCode() {
        return code;
    }


    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
